﻿using System;
using DapperExtensions.Mapper;
using Newtonsoft.Json;

namespace ZilLion.Service.TaskPlatform.Domain.Entity
{
    public class NodeRunMonitorInfoEntity
    {
        /// <summary>
        /// 节点ID
        /// </summary>
        [JsonProperty("nodeid")]
        public string NodeId { get; set; }

        [JsonProperty("nodename")]
        public string Nodename { get; set; }
    
        /// <summary>
        /// 节点是否可用 0-不可用 1-可用
        /// </summary>
        [JsonProperty("noderunstate")]
        public short NodeRunState { get; set; }
        /// <summary>
        /// 最后心跳时间
        /// </summary>
        [JsonProperty("nodelastheartbeat")]
        public DateTime Nodelastheartbeat { get; set; }
    }
    public sealed class NodeRunMonitorInfoMapper : ClassMapper<NodeRunMonitorInfoEntity>
    {
        public NodeRunMonitorInfoMapper()
        {
            Table("node_run_monitor");
            Map(f => f.NodeId).Key(KeyType.Assigned).Column("nodeid");
            Map(f => f.Nodename).Column("nodename");
            Map(f => f.NodeRunState).Column("noderunstate");
            Map(f => f.Nodelastheartbeat).Column("nodelastheartbeat");
           
        }
    }
}